const Koa = require('./lib');
// const Koa = require('koa');


const app = new Koa();
// const KoaRouter = require('@koa/router');
const KoaRouter = require('./lib/router');
const router = new KoaRouter();


router.get('/test2', async (ctx, next) => {
    ctx.body = 'test1';
    await next();
})
router.get('/test', async (ctx, next) => {
    ctx.body = 'test2';
    await next();
})
router.get('/tes2t', async (ctx, next) => {
    ctx.body = 'test2';
    await next();
})
app.use(router.routes());
app.use(async ctx => {
    console.log('aaa');
    ctx.body = 'aa';
})



app.listen(3000, () => {
    console.log('server is listen at 3000');
})